package cn.enine.tbcharge.ui;

import android.app.Fragment;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Window;

import cn.enine.tbcharge.base.MyBaseActivity;
import cn.enine.tbcharge.view.AbBottomTabView;

import java.util.ArrayList;
import java.util.List;
import cn.enine.tbcharge.R;


public class MainActivity extends MyBaseActivity {
	private AbBottomTabView mBottomTabView;
	private List<Drawable> tabDrawables = null;
	SyFragment sy;
	TjFragment tj;
	WdFragment wd;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE); // 注意顺序
		setContentView(R.layout.activity_main);
		mBottomTabView = (AbBottomTabView) findViewById(R.id.mBottomTabView);

		mBottomTabView.getViewPager().setOffscreenPageLimit(5);
		sy = new SyFragment();
		tj = TjFragment.newInstance(super.baseApp);
		wd = new WdFragment();
		List<Fragment> mFragments = new ArrayList<Fragment>();
		mFragments.add(sy);
		mFragments.add(tj);
		mFragments.add(wd);
		List<String> tabTexts = new ArrayList<String>();
		tabTexts.add("收费");
		tabTexts.add("统计");
		tabTexts.add("我的");
		mBottomTabView.setTabTextColor(Color.parseColor("#8a8a8a"));
		mBottomTabView.setTabSelectColor(Color.parseColor("#008B8B"));
		mBottomTabView.setTabBackgroundColor(Color.WHITE);

		tabDrawables = new ArrayList<Drawable>();
		tabDrawables.add(this.getResources().getDrawable(R.drawable.sy1));
		tabDrawables.add(this.getResources().getDrawable(R.drawable.sy2));
		tabDrawables.add(this.getResources().getDrawable(R.drawable.tongji1));
		tabDrawables.add(this.getResources().getDrawable(R.drawable.tongji2));
		tabDrawables.add(this.getResources().getDrawable(R.drawable.wd1));
		tabDrawables.add(this.getResources().getDrawable(R.drawable.wd2));

		mBottomTabView.addItemViews(tabTexts, mFragments, tabDrawables);
		mBottomTabView.setTabPadding(2, 2, 2, 2);
	}

	@Override
	protected void initUI() {

	}

	@Override
	protected void initData() {

	}

	@Override
	protected void initListener() {

	}
}
